package com.sense.kukoo.common.repo.http.bean

import android.os.Parcelable
import kotlinx.parcelize.Parcelize

//	ContentVO
@Parcelize
data class IndexContentBean(

    val audioUrl	:String?,//音频URL	string
    val avatarUrl	:String?,//用户头像URL	string
    val channelName	:String?,//频道名称	string
    val coverUrl	:String?,//封面URL	string
    val description	:String?,//简介	string
    val duration	:Int?,//时长(单位: 秒)	integer(int32)
    val id	        :Long?,//主键ID	integer(int64)
    val level	    :String?,//审核质量:S A N F	string
    val likeNum		:Int?,//integer(int32)
    val listenNum	:Int?,//integer(int32)
    val source	    :Int?,//来源: 1. 自制; 2. 转载;	integer(int32)
    val title	    :String?,//标题	string
    val typeId	    :Long?,//类别ID	integer(int64)
    val userId	    :Long?,//用户ID	integer(int64)
    val state	    :Int?,//状态: -2. 禁用; -1. 未通过; 0. 待审核; 1. 启用	integer(int32)
    val commentNum	:Int?,//评论数量	integer(int32)
    val modifiedAt	:String,//最后修改时间	integer(int64)

): Parcelable{
    companion object{
        val STATE_NORMAL = 1
        val STATE_REVIEWING = 0 //The content is under review and will be released to the public after approval
        val STATE_FAILED = -1 //Content review failed

        fun formate(contentInfo: ContentInfoBean): IndexContentBean{
            return IndexContentBean(
                    audioUrl = contentInfo.audioUrl,
                    avatarUrl = contentInfo.avatarUrl,
                    channelName = contentInfo.channelName,
                    coverUrl = contentInfo.coverUrl,
                    description = contentInfo.description,
                    duration  = contentInfo.duration,
                    id  = contentInfo.id,
                    level = contentInfo.level,
                    likeNum = contentInfo.likeNum,
                    listenNum = contentInfo.listenNum,
                    source = contentInfo.source,
                    title = contentInfo.title,
                    typeId = contentInfo.typeId,
                    userId = contentInfo.userId,
                    state = contentInfo.state,
                    commentNum = contentInfo.commentNum,
                    modifiedAt = contentInfo.modifiedAt,
            )
        }
    }
}
